package com.bifang.module.file.dao.model;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 文件分类参数表
 *
 * @author chenzh
 * @since 2021-01-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("FILE_CLASS")
@Schema(title ="FileClass对象", description = "文件分类参数表")
public class FileClass extends Model<FileClass> {

    private static final long serialVersionUID = 1L;

    @Schema(title = "文件分类编号")
    @TableId(value = "FILE_CLASS_CODE", type = IdType.ASSIGN_ID)
    private String fileClassCode;

    @Schema(title = "分类标题")
    @TableField("CLASS_TITLE")
    private String classTitle;

    @Schema(title = "父类编号")
    @TableField("PARENT_CODE")
    private String parentCode;

    @Schema(title = "文件环境主键")
    @TableField("FILE_ENV_ID")
    private Long fileEnvId;

    @Schema(title = "有效状态 0 无效 1有效")
    @TableField("`STATUS`")
    private String status;

    @Schema(title = "对应档案分类编号")
    @TableField("ARCHIVES_CLASS_CODE")
    private String archivesClassCode;

    @Schema(title = "是否需要归档 0 不需要 1需要")
    @TableField("FIELDER_SHOW")
    private String fielderShow;

    @Schema(title = "组织id")
    @TableField("ORG_ID")
    private String orgId;

    @Schema(title = "文件存放路径")
    @TableField("FILE_CLASS_PATH")
    private String fileClassPath;

    @Schema(title = "是否加密，0 否 1 是")
    @TableField("ENCRYPTION_FLAG")
    private String encryptionFlag;

    @Schema(title = "文件大小限制")
    @TableField("MAX_SIZE")
    private Long maxSize;

    @Schema(title = "文件类型限制")
    @TableField("FILE_TYPE")
    private String fileType;

    @Schema(title = "默认访问过期时间，单位秒")
    @TableField("EXPIRE_TIME")
    private Long expireTime;

    @Schema(title = "预留字段1")
    @TableField("CLASS_PARAM1")
    private String classParam1;

    @Schema(title = "预留字段2")
    @TableField("CLASS_PARAM2")
    private String classParam2;
    @Schema(name = "tableName",title = "保存的表名")
    @TableField(value="table_name",updateStrategy = FieldStrategy.NOT_NULL)
    private String tableName;
    @Schema(title = "备注")
    @TableField("REMARKS")
    private String remarks;
    @Schema(name = "checkScope", description = "是否校验权限 0 不校验 1 校验")
    @TableField("check_scope")
    private String checkScope;

    @Schema(name = "signFlag", description = "调用接口是否需要签名 0 否 1是")
    @TableField("sign_flag")
    private String signFlag;

    @Schema(title = "创建人")
    @TableField(
            value = "CREATE_NAME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(title = "创建时间")
    @TableField(
            value = "CREATE_TIME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(title = "更新人")
    @TableField(
            value = "UPDATE_NAME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(title = "更新时间")
    @TableField(
            value = "UPDATE_TIME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(title = "逻辑删除标志 0 未删除 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(title = "保密级别")
    @TableField("SECRECY_LEVEL")
    private String secrecyLevel;

    @Override
    public Serializable pkVal() {
        return this.fileClassCode;
    }
}
